/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.uoc.tdp.pac4.only5.gui.client.model;

import edu.uoc.tdp.pac4.only5.domain.Resource;
import java.util.List;
import javax.swing.AbstractListModel;

/**
 *
 * @author Gerard
 */
public class ResourceListModel extends AbstractListModel {
    
    private List<Resource> resources;

    public ResourceListModel(List<Resource> resources) {
        this.resources = resources;
    }
   
    @Override
    public int getSize() {
        int i = 0;
        if(resources != null && resources.size() > 0){
            i = resources.size();
        }
        return i;
    }

    @Override
    public Object getElementAt(int i) {
        Object result = null;
        if(resources != null){
            result = resources.get(i);
        }
        return result;
    }
}
